<?php
use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;
use yii\widgets\LinkPager;
use yii\base\Widget;

/* @var $this yii\web\View */
/* @var $searchModel frontend\controllers\search\CourseSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->registerCssFile('/css/search/autocomplete.css');
$this->registerCssFile('/css/search/style.css');
$this->registerCssFile('/css/fenlei.css');
$this->registerCssFile('/css/main.css');
$this->registerCss('
    .wrapper{background:#ecebeb}
    .fenlei{background-color: #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.09);}
    ');
$this->title = '课程中心-尚好课';
$content = "尚好课一个致力于网络课程共享的网站,每天收集来自各网络共享的课程教程资源,IT课程资源,电子商务课程,平面设计课程等课程";
if (isset($_GET['class'])) {
    $this->title = $class['name'] . '课程资源列表-尚好课';
    $content = $class['description'];
}
$this->registerMetaTag([
    'name' => 'description',
    'content' => $content
]);
if (isset($_GET['name'])) {
    $this->title = '课程搜索-尚好课';
}
$this->registerMetaTag([
    'name' => 'keywords',
    'content' => $this->title
]);
?>

<div class="htmleaf-container">
	<hr />
	<form id='searchName'>
		<div id='autocomplete' class="autocomplete-container">
			<input type="text" autocomplete="off" name="name" id='searchClass'
				placeholder="输入课程名" class="autocomplete-input"
				style="border-radius: 3px 0px 0px 3px;">
			<div class="autocomplete-button"
				onclick='jQuery("#searchName").submit()'>搜索</div>
		</div>
	</form>
	<div style='clear: both'></div>
</div>
<br>
<section class="container fenlei" style='padding-bottom: 30px'>
	<hr />
	<div style='text-align: center;'>
		<h1 class=""><?=$this->title?></h1>
	</div>
	<hr />
	<div class="items4 featured_portfolio" style='clear: both'>
		<ul class="item_list">
            <?php foreach($data as $val):?>
            <li style='padding: 0px'
				class="col-md-2 col-sm-3 col-xs-6 courseli"
				data-anim-type="fadeInUp" data-anim-delay="400"><a
				style='border: 1px solid #D0CACA; color: #3A3838'
				href="/course/view/<?=$val['id']?>.html" target="_blank"> <img
					alt='<?=$val['name']?>' src="<?=$val['logo']?>">
					<div class="skuContainer">
						<p class="skuTitle"><?=mb_strimwidth($val['name'], 0, 32, '...','utf-8')?></p>
						<p class="skuInfo">发布时间:<?=date('Y-m-d',$val['create_at'])?></p>
						<p class="skuTitle"><?=$val['look']?>(人)阅读</p>
					</div>
			</a></li>
           
            <?php endforeach;?>
        </ul>
	</div>
	<?=LinkPager::widget(['pagination'=>$pages,'options'=>['class'=>'col-md-12 pagination','style'=>' clear: both;display: block;padding: 20px 0;']])?>
	<hr />
</section>
</div>